﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CSVFormater
{
    class Calculator
    {
        /*四舍五入*/
        private double Round(double v, int x) 
        { 
            bool isNegative = false; 
            //如果是负数 
            if (v < 0) 
            { 
                isNegative = true; 
                v = -v; 
            } 

            int value = 1; 
            
            value = value * 10 * x;

            double IntPart = Math.Round(v * value + 0.5,0);
            v = IntPart / value; 

            if (isNegative) 
            { 
                v = -v; 
            } 

            return v; 
        }
    }
}
